<template>
  <div class="app-container">
    <div class="change">
      <el-divider content-position="left">采购信息：</el-divider>
      <el-table :data="tempData.waimaoDowPurchaselist" border style="width: 100%;border-radius: 8px;">
        <el-table-column align="center" prop="chetonghao" label="合同号" />
        <el-table-column align="center" prop="materialName" label="物料名" />
        <el-table-column align="center" prop="suppliers" label="供应商" />
        <el-table-column align="center" prop="jiahsuiheji" label="价税合计" />
        <el-table-column align="center" prop="jine" label="金额" />
        <el-table-column align="center" prop="nums" label="数量" />
        <el-table-column align="center" prop="tax" label="税额" />
        <el-table-column align="center" prop="units" label="单位" />
        <el-table-column align="center" prop="remarks" label="备注" />
      </el-table>
    </div>
    <div class="change">
      <el-divider content-position="left">销售信息：</el-divider>
      <el-table :data="tempData.waimaoDowMarketlist" border style="width: 100%;border-radius: 8px;">
        <el-table-column align="center" prop="xhetonghao" label="合同号" />
        <el-table-column align="center" prop="materialNames" label="物料名" />
        <el-table-column align="center" prop="shouhuokehu" label="收货客户" />
        <el-table-column align="center" prop="drawback" label="退税" />
        <el-table-column align="center" prop="refundRates" label="退款率" />
        <el-table-column align="center" prop="nums" label="数量" />
        <el-table-column align="center" prop="xtax" label="税额" />
        <el-table-column align="center" prop="unitx" label="单位" />
        <el-table-column align="center" prop="remarksx" label="备注" />
      </el-table>
    </div>
    <div class="change">
      <el-divider content-position="left">银行支出信息：</el-divider>
      <el-table :data="tempData.waimaoDowBankExpendList" border style="width: 100%;border-radius: 8px;">
        <el-table-column align="center" prop="contractNumber" label="合同号" />
        <el-table-column align="center" width="100" prop="paymentForGoods" label="贷款或费用" />
        <el-table-column align="center" prop="shoukuanren" label="收款人" />
        <el-table-column align="center" prop="paymentTime" label="付款时间" />
        <el-table-column align="center" width="120" prop="yjine" label="银行支出金额" />
        <el-table-column align="center" width="120" prop="yjine2" label="银行费用金额" />
        <el-table-column align="center" prop="ynature" label="性质" />
        <el-table-column align="center" prop="yremarks" label="备注" />
      </el-table>
    </div>
    <div class="change">
      <el-divider content-position="left">银行收入信息：</el-divider>
      <el-table :data="tempData.waimaoDowBankIncomelist" border style="width: 100%;border-radius: 8px;">
        <el-table-column align="center" width="150" prop="contractFapiao" label="合同号或发票号" />
        <el-table-column align="center" width="100" prop="huoTuishui" label="退款或退税" />
        <el-table-column align="center" prop="shouRen" label="收款人" />
        <el-table-column align="center" prop="shouTime" label="收款时间" />
        <el-table-column align="center" width="120" prop="shouJine" label="银行收入金额" />
        <el-table-column align="center" width="120" prop="shouJine2" label="银行退税金额" />
        <el-table-column align="center" prop="shouNature" label="性质" />
        <el-table-column align="center" prop="ysremarks" label="备注" />
      </el-table>
    </div>
    <div class="submits">
      <!-- <div class="nosave" @click="nosaveOrder">取消</div> -->
      <div class="save" @click="back">返回</div>
    </div>
  </div>
</template>

<script>
import { useIdSearchDetail } from "@/api/waimao";
export default {
  data() {
    return {
      tempData: {},
      islook: false,
      tableData: [],
      fileNum: [],
      twoClassify: [],
      huikuanlist: [],
      writeOradd: 0, //新增0，编辑1
      heji: 0
    };
  },
  mounted() {
    console.log(this.$route.params);
    const temp = JSON.parse(this.$route.params.options);
    this.getdetail(temp.chetonghao);
  },
  methods: {
    getdetail(id) {
      const loading = this.$loading({
        lock: true,
        text: '加载中请稍等...',
        spinner: 'el-icon-loading',
        background: 'rgba(255, 255, 255, 0.8)'
      })
      useIdSearchDetail(id).then(res => {
        console.log(res);
        this.tempData = res.data[0];
        loading.close()
      }).catch(() => {
        loading.close()
      })
    },
    downloadFile(item) {
      window.location.href = item.fileId;
    },
    // 获取商品文档信息
    getFilesList(id) {
      getUserFiles({ parentId: id }).then(res => {
        console.log(res);
        if (res.data.list.length != 0) {
          this.fileNum = [];
          res.data.list.map(item => {
            this.fileNum.push({
              filename: item.fileDescribe,
              filePath: item.fileName
            });
          });
        }
      });
    },
    // 选择商品分类
    handleChange(value) {
      console.log(value);
      this.tempData.goodsId = value[1];
    },
    downLoad(filepath) {
      window.location.href = filepath;
    },
    nosaveOrder() {
      this.$router.go(-1);
    },
    back() {
      this.$router.go(-1);
    }
  }
};
</script>

<style scoped lang="scss">
/deep/.el-divider {
	background-color: #18A05E;
	position: relative;
}
/deep/.el-divider--horizontal {
    height: 4px;
}
/deep/.el-divider__text {
	color: #18A05E;
}
.table {
  width: 100%;
  border: 1px solid #000000; /* 整体表格边框 */
  border-collapse: collapse;
}
td {
  border: 1px solid #000000;
  font-size: 13px;
  padding: 5px;
}
.container-fluid {
  display: flex;
  align-items: center;
  border: 1px solid #000;
  border-top: none;
  padding: 5px 0;
}
.foot1 {
  flex: 1;
  font-size: 14px;
}
.ellisp {
  width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-align: left;
}
.proimg {
  width: 100px;
  height: 100px;
}
.zishebei {
  background: #fff;
  padding: 20px;
  border-radius: 0 0 8px 8px;
}
/deep/.el-table {
  overflow: visible;
}
.change {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border-radius: 8px 8px 0 0;
  padding: 20px;
  > p {
    width: 33%;
    font-size: 14px;
    display: flex;
    align-items: center;
    color: #333;
    /deep/.el-input__inner {
      // width: inherit;
      background: none;
      height: 32px;
      // line-height: 32px;
      color: #333;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding: 0 25px;
    }
    /deep/.el-input__icon {
      line-height: 32px;
    }
    .userselect {
      // max-width: 250px;
      flex: 1;
    }

    > span {
      display: block;
      width: 120px;
      text-align: right;
      padding-right: 15px;
      &:last-child {
        text-align: left;
        color: #888;
        flex: 1;
      }
    }
    > input {
      width: inherit;
      flex: 1;
      height: 32px;
      border-radius: 3px;
      border: 1px solid rgba(0, 0, 0, 0.1);
      padding-left: 10px;
      color: #333;
    }
  }
}
.submits {
  display: flex;
  padding: 15px 20px;
  background: #fff;
  margin-top: 20px;
  border-radius: 8px;
  justify-content: flex-end;
  align-items: center;
  > div {
    width: 80px;
    height: 32px;
    text-align: center;
    line-height: 32px;
    color: #fff;
    font-size: 14px;
    border-radius: 4px;
    margin-left: 30px;
    cursor: pointer;
  }
  .add {
    background: #18a05e;
  }
  .save {
    background: #2196f3;
  }
  .nosave {
    background: #999;
  }
}
.fileup {
  position: relative;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  // align-items: center;
  justify-content: space-between;
  .uping {
    width: 49%;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    border-radius: 5px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
    > p {
      width: 90%;
      font-size: 14px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      color: #333;
      /deep/.el-input__inner {
        // width: inherit;
        background: none;
        height: 32px;
        // line-height: 32px;
        color: #333;
        border: 1px solid rgba(0, 0, 0, 0.1);
        padding: 0 25px;
      }
      /deep/.el-input__icon {
        line-height: 32px;
      }
      /deep/.el-upload-dragger {
        width: 100%;
        height: 100px;
      }
      /deep/.el-upload-dragger .el-icon-upload {
        font-size: 60px;
        color: #c0c4cc;
        margin: 0;
        line-height: 1;
        width: 100%;
      }
      /deep/.el-upload {
        width: 100%;
      }
      .userselect {
        // max-width: 250px;
        flex: 1;
      }

      > span {
        display: block;
        width: 100px;
        text-align: right;
        padding-right: 15px;
        &:last-child {
          text-align: left;
          color: #888;
        }
      }
      > input {
        width: inherit;
        flex: 1;
        height: 32px;
        border-radius: 3px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        padding-left: 10px;
        color: #333;
      }
      > strong {
        display: inline-block;
        padding-right: 50px;
        font-weight: 100;
        font-size: 14px;
        &:last-child {
          cursor: pointer;
          color: #13ce66;
          font-weight: 600;
        }
      }
      > div {
        width: inherit;
        flex: 1;
      }
    }
  }
}
.zd3-btm {
  background: rgba(255, 255, 255, 1);
  border-radius: 8px;
  // border: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  overflow: hidden;
  &-title {
    display: flex;
    align-items: center;
    height: 70px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    > p {
      text-align: center;
      font-size: 16px;
      color: #333;
    }
  }
  .el-pagination {
    white-space: nowrap;
    padding: 15px 5px;
    color: #303133;
    font-weight: bold;
  }
  .addDate {
    margin: 20px 32px 10px 32px;
    height: 32px;
    border-radius: 3px;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border: 1px dashed rgba(0, 0, 0, 0.25);
  }
  .el-button--text {
    margin: 0 15px;
  }
}
</style>
